home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Graphics / Plotting / aa_Intel_Only / Gnuplot / GnuplotSource / Status.h < prev    next >
Encoding:
Text File  |  1995-06-12  |  6.4 KB  |  231 lines

  1. /*
  2.  *  Copyright (C) 1993  Robert Davis
  3.  *
  4.  *  This program is free software; you can redistribute it and/or
  5.  *  modify it under the terms of Version 2, or any later version, of 
  6.  *  the GNU General Public License as published by the Free Software 
  7.  *  Foundation.
  8.  */
  9.  
  10. /* $Id: Status.h,v 1.10 1993/05/18 03:55:38 davis Exp $ */
  11.  
  12.  
  13. #import <objc/Object.h>
  14. #import <streams/streams.h>    /* NXStream */
  15.  
  16. @class List, DoubleValueSortedList;
  17.  
  18. #define    X_TAG    0
  19. #define    Y_TAG    1
  20. #define    Z_TAG    2
  21. #define    R_TAG    3
  22. #define ANGLES_RADIANS        0
  23. #define ANGLES_DEGREES        1
  24.  
  25. @interface Status:Object
  26. {
  27.     NXZone    *zone;        /* Our zone                */
  28.     id        delegate;    /* Whom to inform if settings change    */
  29.  
  30.     BOOL    report;        /* Report setting changes to delegate?    */
  31.  
  32.     char    *text;        /* Command text that we pass to gnuplot    */
  33.     NXStream    *s_epsStream;    /* Term writes EPS to this stream    */
  34.  
  35.     char    *s_plotargs;    /* Arguments for a plot command        */
  36.     List    *functions;    /* List of FunctionObjects, which store    */
  37.                 /* info about functions (titles, style)    */
  38.  
  39.     char    *appendix;    /*
  40.                  *  Appendix is a postamble where we 
  41.                  *  can put newline-separated Gnuplot 
  42.                  *  commands that will override any of 
  43.                  *  the settings.  We use it to 
  44.                  *  process the text read from a file, 
  45.                  *  before we've had a chance to set 
  46.                  *  the instance variables.
  47.                  */
  48.  
  49.     BOOL areSettingsEdited;    /* Do the plotargs and text need to be    */
  50.                 /* rebuilt?                */
  51.  
  52.  
  53.     /*** Gnuplot Settings ***/
  54.  
  55.     char    *s_title;    /* Plot title                */
  56.  
  57.     BOOL    s_parametric;    /* Is this a parametric plot?        */
  58.     BOOL    s_polar;    /* Is this a polar plot?        */
  59.     BOOL    s_border;    /* Does it have a border?        */
  60.     BOOL    s_grid;        /* Does it have a grid?            */
  61.     BOOL    degrees;    /* Are ranges in degrees? (Or radians?)    */
  62.  
  63.     int        s_fontsize;    /* Font size in points            */
  64.     char    *s_font;    /* Font string. Example: "Times-Roman"    */
  65.  
  66.     BOOL    isThreeD;    /* Is this a 3D plot (or just 2D)?    */
  67.     BOOL    s_draw_surface;    /* Should we show the surface?        */
  68.     BOOL    s_hidden3d;    /* Are the hidden lines removed?    */
  69.  
  70.     BOOL    s_zeroaxis[2];    /* Should we show the x- or y-zeroaxis?    */
  71.     BOOL    s_isLogCoord[3][2];    /* Is this axis a log scale?    */
  72.     char    *s_labelCoord[3];    /* Labels for the axes        */
  73.     char    *s_dummy_var[2];    /* Dummy vars for functions    */
  74.  
  75.     BOOL    s_key;        /* Is there a key?            */
  76.     BOOL    s_key_default;    /* Would a key be in the default loc.?    */
  77.     double    s_keyCoord[3];    /* Location of the key if not default    */
  78.  
  79.     BOOL    s_time;        /* Should we show the time/date?    */
  80.     BOOL    s_time_default;    /* Should time/date be in default loc.?    */
  81.     int        s_timeCoord[3];    /* Location of time/date if not default    */
  82.  
  83.     BOOL    sizeProp;    /* Should we keep x & y proportional?    */
  84.     float    s_xsize,s_ysize;/* Size of the plot            */
  85.  
  86.     float    s_rotCoord[3];    /* How the 3D view is rotated        */
  87.  
  88.     int        s_samples;    /* Number of samples per function plot    */
  89.     int        s_samplesCoord[2];
  90.     int        s_iso_samplesCoord[2];
  91.  
  92.     BOOL    s_autoscaleCoord[4][2]; /* Autoscaling on X, Y, Z, or R? */
  93.  
  94.     double    s_minCoord[3][2];    /* Axis Ranges            */
  95.     double    s_maxCoord[3][2];
  96.  
  97.  
  98.     /* Contour Category */
  99.  
  100.     BOOL    contourBase;        /* Contours on base?        */
  101.     BOOL    contourSurface;        /* Contours on surface?        */
  102.     int        s_contour_kind;        /* Type of contour        */
  103.     int        s_contour_pts;
  104.     int        s_contour_order;
  105.     int        s_contour_levels;
  106.     int        s_levels_kind;
  107.     DoubleValueSortedList *levelDefs;
  108.     struct _levelsSeries {
  109.     double    start, incr, end;
  110.     }        s_levelsSeries;
  111.     BOOL    s_label_contours;
  112.  
  113.  
  114.     /* Tics Category */
  115.  
  116.     BOOL    s_tics_in;        /* Tics in (or out)?        */
  117.     BOOL    s_ticsCoord[3];        /* Axis have tics at all?    */
  118.     int        s_ticTypeCoord[3];    /* Tic type of coord        */
  119.     struct _ticSeries {
  120.     double start, incr, end;
  121.     }        s_ticSeriesCoord[3];    /* Tics Series parameters    */
  122.     DoubleValueSortedList *ticDefs[3];    /* Custom, user-defined tics    */
  123.  
  124. }
  125.  
  126. + lastplot;
  127. + setHalvePlot:(BOOL)condition;
  128.  
  129. - init;
  130. - free;
  131.  
  132. - setDelegate: anObject;        /* Must respond to settingsDidChage: */
  133. - delegate;
  134. - setReport:(BOOL)cond;            /* Report changes to delegate?         */
  135. - (BOOL)report;
  136.  
  137. - setAppendix:(const char *) aString;
  138. - (NXStream *)stream;
  139.  
  140. - plot;                    /* Plot current settings    */
  141. - (BOOL)canPlot;            /* Can we plot current settings    */
  142.  
  143. - saveToFile:(const char *)filename;    /* Save current settings    */
  144. - reportSettingsChange:sender;        /* Inform delegate of change    */
  145. - resetCurrent;                /* Reset settings to defaults    */
  146. - applyCurrent;                /* Set gnuplot vars from ours    */
  147. - grabCurrent;                /* Set our vars from gnuplot's    */
  148.  
  149. - (List *)functions;
  150.  
  151. - setTitle:(const char *) aString;    /* Setting instance variables    */
  152. - (const char *) title;
  153.  
  154. - setParametric:(BOOL) cond;
  155. - (BOOL) parametric;
  156. - setPolar:(BOOL) cond;
  157. - (BOOL) isPolar;
  158. - setBorder:(BOOL) cond;
  159. - (BOOL) border;
  160. - setGrid:(BOOL) cond;
  161. - (BOOL) grid;
  162. - setDegrees:(BOOL) cond;
  163. - (BOOL)degrees;
  164.  
  165. - setFontsize:(int) anInt;
  166. - (int) fontsize;
  167. - setFontname:(const char *) aString;
  168. - (const char *) fontname;
  169. - setFont:aFont;        /* Sets fontname and fontsize from aFont */
  170. - font;                /* Returns a Font object */
  171.  
  172. - setThreeD:(BOOL) aCondition;
  173. - (BOOL) isThreeD;
  174. - setSurface:(BOOL) cond;
  175. - (BOOL) surface;
  176. - setHiddenThreeD:(BOOL) cond;
  177. - (BOOL) hiddenThreeD;
  178.  
  179.  
  180.                     /* Pertaining to a certain coord.*/
  181. - setAxisCoord:(int)coord on:(BOOL)cond;
  182. - (BOOL) axisCoord:(int)coord;
  183.  
  184. - setIsLogCoord:(int)coord isOn:(BOOL)isOn;
  185. - (BOOL)isLogCoord:(int)coord;
  186.  
  187. - setLabelCoord:(int)coord to:(const char *) aString;
  188. - (const char *) labelCoord:(int) coord;
  189.  
  190. - setDummyVar:(int)coord to:(const char *)aString;
  191. - (const char *)dummyVar:(int)coord;
  192.  
  193. - setKey:(BOOL) cond;
  194. - (BOOL) key;
  195. - setKeyDefault: (BOOL) cond;
  196. - (BOOL) keyDefault;
  197. - setKeyCoord:(int)coord to:(double)aDouble;
  198. - (double) keyCoord:(int)coord;
  199.  
  200. - setTime:(BOOL) cond;
  201. - (BOOL) time;
  202. - setTimeDefault: (BOOL) cond;
  203. - (BOOL) timeDefault;
  204. - setTimeCoord:(int)coord to:(int)anInt;
  205. - (int) timeCoord:(int)coord;
  206.  
  207. - setSizeProp:(BOOL) cond;
  208. - (BOOL) sizeProp;
  209. - setSizeX:(float) xFloat Y:(float) yFloat;
  210. - (float) sizeX;
  211. - (float) sizeY;
  212.  
  213. - setRotCoord:(int)coord to:(float)aFloat;
  214. - resetRotation;
  215. - (float)rotCoord:(int)coord;
  216.  
  217. - setSamplesCoord:(int)coord to:(int) anInt;
  218. - (int) samples:(int)coord;
  219.  
  220. - setIsoSamplesCoord:(int)coor to:(int) anInt;
  221. - (int) isoSamples:(int)coord;
  222.  
  223. - setAutoscaleCoord:(int)coord isOn:(BOOL)cond;
  224. - (BOOL)autoscaleCoord:(int)coord;
  225.  
  226. - setRangeCoord:(int)coord min:(double)min max:(double)max;
  227. - (double)minCoord:(int)coord;
  228. - (double)maxCoord:(int)coord;
  229.  
  230. @end
  231.